{include file='fcworker/fc_head'}
<style>
    .sub-div{
        width: 100%;
        text-align: center;
        margin: 0 auto;
    }
    .sub-btn{
        width: 184px;
        height: 35px;
        background-color: #5c99f7;
        border-radius: 50px;
        border: 0;
        margin-top: 20px;
        color: #fff;
        font-size: 15px;
        font-weight: 400;
    }
</style>
<body style="background:#f8f8f8">
<div id="mescroll" class="mescroll">
    <div id="app">
        <div class="setTitle_h">
            <a href="javascript:history.back(-1)"></a>
            手机端管理设置
        </div>
        <form id="myform3">
            <div class="setActive">
                <ul>
                    {if !$config['is_multiple_merchants']}
                    <li>
                        <p>添加员工密码</p>
                        <input name="workerpass" type="number" value="{$config['workerpass']}">
                    </li>
                    {/if}
                    <li>
                        <p>员工修改客户定单</p>
                        <div class="choseBar2 choseBar11">
                            <span  class="{php echo $config['iseditorder']==0?'on':'';}" data-value="0"  >不可修改</span>
                            <span class="{php echo $config['iseditorder']==1?'on':'';}" data-value="1">可修改</span>
                        </div>
                        <input type="hidden" name="iseditorder" id="iseditorder" value="{$config['iseditorder']}">
                    </li>
                    <li>
                        <p>员工修改所属团</p>
                        <div class="choseBar2 choseBar112">
                            <span  class="{php echo $config['iseditgroup']==0?'on':'';}" data-value="0"  >不可修改</span>
                            <span class="{php echo $config['iseditgroup']==1?'on':'';}" data-value="1">可修改</span>
                        </div>
                        <input type="hidden" name="iseditgroup" id="iseditgroup" value="{$config['iseditgroup']}">
                    </li>
                    <li>
                        <p>员工查团队日报</p>
                        <div class="choseBar2 choseBar12">
                            <span  class="{php echo $config['isreport']==0?'on':'';}" data-value="0"  >不可查看</span>
                            <span class="{php echo $config['isreport']==1?'on':'';}" data-value="1">可查看</span>
                        </div>
                        <input type="hidden" name="isreport" id="isreport" value="{$config['isreport']}">
                    </li>
                    <li>
                        <p>员工查团队排名</p>
                        <div class="choseBar2 choseBar13">
                            <span  class="{php echo $config['isrank']==0?'on':'';}" data-value="0"  >不可查看</span>
                            <span class="{php echo $config['isrank']==1?'on':'';}" data-value="1">可查看</span>
                        </div>
                        <input type="hidden" name="isrank" id="isrank" value="{$config['isrank']}">
                    </li>
                    {if $config['is_multiple_merchants']}
                    <li>
                        <p>商家管理员查看排名</p>
                        <div class="choseBar2 choseBar14">
                            <span  class="{php echo $config['isshoprank']==0?'on':'';}" data-value="0"  >不可查看</span>
                            <span class="{php echo $config['isshoprank']==1?'on':'';}" data-value="1">可查看</span>
                        </div>
                        <input type="hidden" name="isshoprank" id="isshoprank" value="{$config['isshoprank']}">
                    </li>
                    {/if}
                    <li>
                        <p>员工线下录入</p>
                        <div class="choseBar2 choseBar15">
                            <span  class="{php echo $config['isxianxia']==0?'on':'';}" data-value="0"  >不可录入</span>
                            <span class="{php echo $config['isxianxia']==1?'on':'';}" data-value="1">可录入可删除</span>
                            <span class="{php echo $config['isxianxia']==2?'on':'';}" data-value="2">可录入不可删除</span>
                        </div>
                        <input type="hidden" name="isxianxia" id="isxianxia" value="{$config['isxianxia']}">
                    </li>
                    <li>
                        <p>交易凭证样式</p>
                        <div class="choseBar2 choseBar16">
                            <span  class="{php echo $config['examplestyle']==0?'on':'';}" data-value="0"  >系统红包</span>
                            <span class="{php echo $config['examplestyle']==1?'on':'';}" data-value="1">客户支付凭证</span>
                        </div>
                        <input type="hidden" name="examplestyle" id="examplestyle" value="{$config['examplestyle']}">
                    </li>
                    {if $config['examplestyle']==0}
                    <li class="examplestyle" >
                        <p>交易凭证二维码</p>
                        <div class="choseBar2 choseBar17">
                            <span  class="{php echo $config['isexampleqr']==0?'on':'';}" data-value="0"  >H5不显示+小程序显示</span>
                            <span class="{php echo $config['isexampleqr']==1?'on':'';}" data-value="1">全显示</span>
                            <span class="{php echo $config['isexampleqr']==2?'on':'';}" data-value="2">全不显示</span>
                        </div>
                        <input type="hidden" name="isexampleqr" id="isexampleqr" value="{$config['isexampleqr']}">
                    </li>
                    {else}
                    <li class="examplestyle" style="display: none">
                        <p>交易凭证二维码</p>
                        <div class="choseBar2 choseBar17">
                            <span  class="{php echo $config['isexampleqr']==0?'on':'';}" data-value="0"  >H5不显示+小程序显示</span>
                            <span class="{php echo $config['isexampleqr']==1?'on':'';}" data-value="1">全显示</span>
                            <span class="{php echo $config['isexampleqr']==2?'on':'';}" data-value="2">全不显示</span>
                        </div>
                        <input type="hidden" name="isexampleqr" id="isexampleqr" value="{$config['isexampleqr']}">
                    </li>
                    {/if}
                </ul>
            </div>
            <div class="sub-div">
                <button class="sub-btn" id="sub3" type="button">提交</button>
            </div>
        </form>
        {include file='fcworker/fc_foot_yixuan'}
        <div class="h110"></div>

    </div>
</div>
{include file='fcworker/fc_foot'}
</body>
<script>
    const mescroll = new MeScroll("mescroll", {
        down: {
            auto: false,
            callback: () => {
                mescroll.endSuccess();
                setTimeout(() => {
                    window.location.reload();
                },500)
            }
        },
        up: {
            use: false
        }
    })
    $('.choseBar11 span').click(function(){
        var iseditorder = $(this).data("value");
        $("#iseditorder").val(iseditorder);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar112 span').click(function(){
        var iseditgroup = $(this).data("value");
        $("#iseditgroup").val(iseditgroup);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar12 span').click(function(){
        var isreport = $(this).data("value");
        $("#isreport").val(isreport);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar13 span').click(function(){
        var isrank = $(this).data("value");
        $("#isrank").val(isrank);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar14 span').click(function(){
        var isshoprank = $(this).data("value");
        $("#isshoprank").val(isshoprank);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar15 span').click(function(){
        var isxianxia = $(this).data("value");
        $("#isxianxia").val(isxianxia);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar16 span').click(function(){
        var examplestyle = $(this).data("value");
        console.log(examplestyle);
        if (!examplestyle){
            $(".examplestyle").show();
        }else{
            $(".examplestyle").hide();
        }
        $("#examplestyle").val(examplestyle);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.choseBar17 span').click(function(){
        var isexampleqr = $(this).data("value");
        $("#isexampleqr").val(isexampleqr);
        $(this).addClass('on').siblings().removeClass('on');
    })

    $('.moreChose span').click(function(){
        if($(this).hasClass('on')){
            $(this).removeClass('on')
        }else{
            $(this).addClass('on')
        }
    })
    $("#sub3").click(function () {
        var formData3 = $("#myform3").serializeArray();
        let datalist = {};
        $.each(formData3,function (index,item) {
            datalist[item.name] = item.value;
        });
        datalist['op'] = 'save';
        var postUrl="/{php echo createMobileUrl('X_setmobile',array('themeid'=>$themeid));}";
        $.ajax({
            url:postUrl,
            dataType:'json',
            method:'post',
            data: datalist,
            success:function (e) {
                let data = e.data;
                let error = e.error;
                let msg = e.msg;
                if (error){
                    layer.msg(msg);
                    return;
                }else{
                    layer.msg('保存成功');
                    self.location.href = postUrl;
                }
            },
            fail:function (err) {
            }
        });
    });
</script>
</html>